home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_11_05
/
1105034a
< prev
next >
Wrap
Text File
|
1993-03-02
|
288b
|
16 lines
// Copyright (C) 1992 by Nicholas Wilt. All rights reserved.
template<class T>
void
InsertionSort(T *base, int n)
{
for (int i = 1; i < n; i++) {
T temp = base[i];
for (int j = i; j && temp < base[j - 1]; j--)
base[j] = base[j - 1];
base[j] = temp;
}
}